<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Headroom使用</title>
  <link rel="stylesheet" href="../src/css/normalize-v2.1.0.css">
  <style>

    .headroom {
      position: fixed;
      top: 0;
      left: 0;
      background-color: #000;
      color: #fff;
      font-size: 24px;
      width: 100%;
      height: 60px;
      line-height: 60px;
      text-align: center;
      z-index: 10;
    }

    section {
      margin: 0 auto;
      width: 300px;
      font-size: 300px;
      color: #cacaca;
    }
  </style>
</head>
<body>
  <header class="headroom animated">HeadRoom</header>
  <section>
    测试区域
  </section>
  <script src="../src/js/headroom.js">Header</script>
  <script>
    Headroom.options = {
      tolerance: {
        up: 0,
        down: 0
      },
      offset: 0,
      scroller: window,
      classes: {
        pinned: 'slideDown',
        unpinned: 'slideUp',
        top: 'headroom--top',
        notTop: 'headroom--not-top',
        bottom: 'headroom--bottom',
        notBottom: 'headroom--not-bottom',
        initial: 'headroom'
      }
    };
    // 获取页面元素
    var myElement = document.querySelector('header');
    //创建headroom对象，将页面元素传递进去
    var headroom = new Headroom(myElement);

    headroom.init();
    console.log(headroom);
  </script>
</body>
</html>